package com.hotel.tv.runtime.session.impl;

import com.hotel.tv.constants.HotelUserTypeConstant;
import com.hotel.tv.runtime.session.HotelAdminSession;

/**
 * 管理端会话
 * <p>
 * </p>
 *
 * @description TODO
 * @author: 老码农
 * @create: 2020-04-02 21:45
 **/
public class HotelAdminSessionImpl extends AbstractHotelSession implements HotelAdminSession {

    @Override
    public boolean isAdministratorUser() {
        Integer userType = this.getUserType();
        return userType != null && userType.equals(HotelUserTypeConstant.ADMIN);
    }

    @Override
    public boolean isHotelUser() {
        Integer userType = this.getUserType();
        return userType != null && userType.equals(HotelUserTypeConstant.HOTEL_ADMIN);
    }

    @Override
    public Long getOrganizeId() {
        return this.getIdentityClaims().getLongClaims(FIELD_ORGANIZE_ID);
    }


}

